@W-21740433 - Add PFT telemetry support for Code Analyzer MCP tools#430
Open
aruntyagiTutu wants to merge 5 commits intomainfrom
Open
@W-21740433 - Add PFT telemetry support for Code Analyzer MCP tools#430aruntyagiTutu wants to merge 5 commits intomainfrom
aruntyagiTutu wants to merge 5 commits intomainfrom
Conversation
Adds Product Feedback Telemetry (PFT) support to all Code Analyzer MCP tools following the pattern established in PR #397. Changes: - Updated TelemetryService interface to include sendPdpEvent() method with PdpEvent type - Added PFT events to all 6 Code Analyzer tools after successful execution: * run_code_analyzer (codeAnalyzer.run) * query_code_analyzer_results (codeAnalyzer.query) * list_code_analyzer_rules (codeAnalyzer.listRules) * describe_code_analyzer_rule (codeAnalyzer.describeRule) * create_custom_rule (codeAnalyzer.createCustomRule) * generate_xpath_prompt (codeAnalyzer.generateXpathPrompt) Each PFT event includes: - eventName: Descriptive event name for analytics - productFeatureId: aJCEE0000007Uiv4AE (placeholder - TODO: Get specific Code Analyzer ID) - componentId: Tool name for tracking individual tool usage This enables product analytics tracking for Code Analyzer tool adoption and usage patterns.
- Define CODE_ANALYZER_PRODUCT_FEATURE_ID constant in constants.ts - Replace all hardcoded product feature IDs with this constant - Use correct Code Analyzer ID: aJCEE0000000mDK4AY This ensures the product feature ID is defined in one place for easier maintenance and updates.
Updates TelemetryService interface to match the PdpEvent type definition
from @salesforce/telemetry package, ensuring type compatibility across
the MCP server and all provider packages.
Changes:
- Updated PdpEvent type in mcp-provider-api:
* eventName: string → `${string}.${string}` (enforces "object.action" format)
* productFeatureId: string → `aJC${string}` (enforces GUS Product Feature ID format)
* componentId: string → optional string
- Added sendPdpEvent() method to NoopTelemetryService
- Exported PdpEvent type from mcp-provider-api index
- Updated mcp-provider-code-analyzer to use file:../mcp-provider-api for local development
This ensures all PFT telemetry calls use consistent type definitions that
match the @salesforce/telemetry TelemetryReporter implementation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Product Feedback Telemetry (PFT) for all Code Analyzer MCP tools following the pattern established in PR #397.
Changes
1. Updated TelemetryService Interface
File:
packages/mcp-provider-api/src/services.tssendPdpEvent()method to TelemetryService interfacePdpEventtype definition with fields:eventName,productFeatureId,componentId,eventVolume2. Centralized Product Feature ID
File:
packages/mcp-provider-code-analyzer/src/constants.tsCODE_ANALYZER_PRODUCT_FEATURE_ID = "aJCEE0000000mDK4AY"3. Implemented PFT Events in All 6 Tools
Added
sendPdpEvent()calls after successful tool execution:codeAnalyzer.runrun_code_analyzercodeAnalyzer.queryquery_code_analyzer_resultscodeAnalyzer.listRuleslist_code_analyzer_rulescodeAnalyzer.describeRuledescribe_code_analyzer_rulecodeAnalyzer.createCustomRulecreate_custom_rulecodeAnalyzer.generateXpathPromptget_ast_nodes_to_generate_xpath